//
// Created by 86155 on 2025/4/15.
//
#include "TargetInfo/FeTargetInfo.h"
#include "llvm/MC/TargetRegistry.h"

using namespace llvm;

namespace llvm {

Target &getFeTarget() {
  static Target FeTarget;
  return FeTarget;
}

} // end namespace llvm

/*llc的目标后端都必须实现各自的void LLVMInitializeXXXTargetInfo()函数。否则，编译目标后端MyRISCV时会报错undefined reference to 'LLVMInitializeMyRISCVTargetInfo'。*/
//将fe新后端头插法插入一个链表中
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeFeTargetInfo() {
  RegisterTarget<Triple::fe> X(getFeTarget(), "fe",
                                      "FE 32-bit", "Fe");
}